package com.example.carbon.dao;

import com.example.carbon.pojo.MaterialInfo;
import com.example.carbon.pojo.dto.ProduceModelDtoInsert;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MaterialInfoDao {

    @Select("select  * from material_info where classification=#{classification}")
    List<MaterialInfo> selectAllInfoByClassification(String classification);
    @Select("select * from material_info")
    List<MaterialInfo> selectAllInfoBy();

    @Delete("delete  from product_model where  id=#{id}")
    boolean delInfoById(int id);

    @Insert("insert into product_model(produce,p_type,p_specifications,model_name,demo,input_time,update_time)" +
            " values (#{name},#{type},#{specifications},#{model_name},#{demo},now(),now())")
    boolean insertNewInfo(ProduceModelDtoInsert produceModelDtoInsert);
}
